Accusoft.ImagXpress13.ActiveX
Display Image

To display an image:

  1. Ensure that ViewUpdate is true, to specify that the display paint whenever there is a request to paint.
  2. Ensure that AutoInvalidate is true, to specify that a repaint should be performed whenever there is a change to the image.
  3. Set Notify to true if Notify events are to be generated when the control paints. The length of delay between painting and notifying is specified by the NotifyDelay property.
When Notify is true, a Notify event occurs every time the control paints. There are many factors that can cause a control to paint which may not always be apparent. This can sometimes lead to unexpected results, such as infinite loops.

The following VB code illustrates how a recursive loop can occur and potentially cause a stack overflow error:

VB Example
Copy Code
' The wrong way to do it
Sub ImagXpress1_Notify()
     ' Changing the border causes a repaint which generates another Notify event
     ImagXpress1.BorderType = 1
     ' Changing the filename causes a repaint which generates another Notify event
     ImagXpress1.FileName = "C:\PIC1.BMP"
     DoEvents
End Sub
You can prevent loops like this from occuring by either setting the Notify property to False to prevent a Notify event from occurring, or setting the ViewUpdate property to False to also prevent the control from repainting.
  1. Set the ViewImageID to the image to display. The control window will display the image identified by ViewImageID property when the window next paints.

The frequency of painting to the ImagXpress® control window is determined by the settings in Windows. If a paint is required immediately, the Paint method forces an immediate paint of the control window. The PaintDC method forces an immediate paint to a specified device (monitor or printer). Call DIBUpdate method to update the control's display with the current DIB.

Display Different Images Within One Control Window

To change the image being displayed, assign ViewImageID to a different image buffer. This image displays when the control window next paints. When an image loads into ImagXpress, the ViewImageID is assigned to the newly loaded image and the image is displayed automatically. The ViewStatus property indicates the status (for example, opened, decoded, wait, saved, etc.) of the image in the ViewImageID buffer. 

Display Different Images at the Same Time

Each ImagXpress control that loads can display a different image, so loading multiple controls enables display of multiple images. The ManagePalette property specifies how palettes are applied across multiple control windows. When ManagePalette is True, the palette of the image displays in the top (z-level) control in the project and applies to all ImagXpress control windows. This enables a user to retain a consistent palette across multiple displayed images. When ManagePalette is False, each control window retains its own palette. 

Display Multiple Simultaneous Views of the Same Image

Each ImagXpress control can display only one image at a time. Sometimes it is necessary to display multiple views of the same image. A typical use would be to display a "before" and "after" view of an image with some image rendering options changed.

To view the same image using multiple ImagXpress controls, load the image into the first control and assign its ViewImageID to the second control's ViewImageID. Now the two views share the image. 

VB Example
Copy Code
// This code demonstrates how to view the same image using multiple ImagXpress controls
IX10a.FileName = "a.gif"
IX10b.ViewImageID = IX10a.ViewImageID 

Display Image Information in the Control Window

To display a dialog box with information about the image being displayed, call ShowViewImageInfo method.

See Also

 

 


©2019. Accusoft Corporation. All Rights Reserved.

Send Feedback